\documentclass[12pt,a4paper,oneside]{article}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[singlespacing]{setspace}
\usepackage{natbib}
\usepackage{fullpage}
\usepackage{tikz}
\usepackage{tkz-tab}
\usepackage{pgfplots}
\usepackage{footmisc}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{pgfplots}
\usepackage{blindtext}
\usepackage[inline]{enumitem}
\usepackage{multirow}
\usepackage[normalem]{ulem}
\usepackage{color, soul}
\usepackage{eurosym}
\usepackage{xcolor}
\usepackage{comment}
\usepackage{titlesec}
\usepackage{bbm}
\usepackage{booktabs}
\usepackage{hyperref}
\pgfplotsset{compat=1.10}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{patterns}
\usetikzlibrary{positioning}

\begin{document}

\section*{This is the latex code used to produce Figures 1, 2, 3, A1, A2, and A3 of the paper.}

\renewcommand{\thefigure}{1}
\begin{figure}[ht]
\begin{subfigure}{.3\linewidth}
        \centering
        \resizebox{\linewidth}{!}{
\begin{tikzpicture}
\begin{axis}[
xmin=0,xmax=1,ymin=0,ymax=1.01,
    axis lines = left,
    xlabel = $v_j$,
    ylabel = {$s_j$},
]
\addplot [name path=A,
    domain=0:1, 
    samples=100, line width=0.7mm
]
{x};

\end{axis}
\end{tikzpicture}
}
\caption{$n=1$}
\end{subfigure}
\begin{subfigure}{.3\linewidth}
        \centering
        \resizebox{\linewidth}{!}{
\begin{tikzpicture}
\begin{axis}[
xmin=0,xmax=1,ymin=0,ymax=1.01,
    axis lines = left,
    xlabel = $v_j$,
    ylabel = {$s_j$},
]


\addplot [ name path=B,
    domain=0:1, 
    samples=100 ,line width=0.7mm
]
{max(0,min((1-3)/2+3*x,1))};

\addplot [name path=D,
    domain=0:1, 
    samples=100, dotted, very thick
]
{x};

\addplot[darkgray, opacity=0.4] fill between[of=B and D, soft clip={domain=0.5:1}];
\end{axis}
\end{tikzpicture}
}
\caption{$n=3$}
\end{subfigure}
\begin{subfigure}{.3\linewidth}
        \centering
        \resizebox{\linewidth}{!}{
\begin{tikzpicture}
\begin{axis}[
xmin=0,xmax=1,ymin=0,ymax=1.01,
    axis lines = left,
    xlabel = $v_j$,
    ylabel = {$s_j$},
]

\addplot [name path=C,
    domain=0:1, 
    samples=100, line width=0.7mm
]
{max(0,min((1-1000)/2+1000*x,1))};

\addplot [name path=D,
    domain=0:1, 
    samples=100, dotted, very thick
]
{x};

\addplot[darkgray, opacity=0.4] fill between[of=C and D, soft clip={domain=0.5:1}];
\end{axis}
\end{tikzpicture}
}
\caption{$n\rightarrow \infty$}
\end{subfigure}
\caption{Seat share allocation given parties' vote shares according to the Linear rule where the electoral rule disproportionality $D$ (in gray) is increasing in $n$.}
\label{fig:thresholdmain}
\end{figure}

\medskip

\renewcommand{\thefigure}{2}

\begin{figure}[ht]
\begin{subfigure}{.5\linewidth}
        \centering
        \resizebox{\linewidth}{!}{
\begin{tikzpicture}
\begin{axis}[
ymajorgrids=true,
xmajorgrids=true,
xmin=0,xmax=1,ymin=0,ymax=4.01,
    axis lines = left,
    width=10cm,
    xlabel = $x$,
    ylabel = {$f(x)$},
]
\addplot[domain=0:2/10, mark=*, black  ] {0};
\addplot[domain=2/10:4/10,mark=*, black  ] {3};
\addplot[name path=A, domain=4/10:8/10,mark=*, black  ] {0};
\addplot[name path=B, domain=8/10:9/10,mark=*, black  ] {4};
\addplot[name path=B, domain=9/10:10/10,mark=*, black  ] {0};

\addplot[
        mark=*,
        black , dashed
      ] plot coordinates {
        (0.2,0)
        (0.2,3)
      };

\addplot[
        mark=*,
        black , dashed
      ] plot coordinates {
        (0.4,0)
        (0.4,3)
      };

\addplot[
        mark=*,
        black , dashed
      ] plot coordinates {
        (0.8,0)
        (0.8,4)
      };

\addplot[
        mark=*,
        black , dashed
      ] plot coordinates {
        (0.9,0)
        (0.9,4)
      };

\end{axis}
       \node[below] at (7.6,-0.06) {$0.9$};
              \node[below] at (2.5,4) {$s_L=0.6$};
       \node[below, rotate=90] at (6.9,3.8) {$s_R=0.4$};

\draw[help lines, black, dashed] (4.85,0) grid (4.85,3.4);

        \node[below, rotate=90] at (4.4,1.7) {Indifferent voter};

\end{tikzpicture}
}
\caption{Linear rule and $n=1$.}
  \label{fig:parliamentup}
\end{subfigure}
\begin{subfigure}{.5\linewidth}
        \centering
        \resizebox{\linewidth}{!}{
\begin{tikzpicture}
\begin{axis}[
ymajorgrids=true,
xmajorgrids=true,
xmin=0,xmax=1,ymin=0,ymax=4.01,
    axis lines = left,
    width=10cm,
    xlabel = $x$,
    ylabel = {$f(x)$},
]
\addplot[domain=0:2/10, mark=*, black  ] {0};
\addplot[domain=2/10:4/10,mark=*, black  ] {4};
\addplot[name path=A, domain=4/10:8/10,mark=*, black  ] {0};
\addplot[name path=B, domain=8/10:9/10,mark=*, black  ] {2};
\addplot[name path=B, domain=9/10:10/10,mark=*, black  ] {0};

\addplot[
        mark=*,
        black , dashed
      ] plot coordinates {
        (0.2,0)
        (0.2,4)
      };

\addplot[
        mark=*,
        black , dashed
      ] plot coordinates {
        (0.4,0)
        (0.4,4)
      };

\addplot[
        mark=*,
        black , dashed
      ] plot coordinates {
        (0.8,0)
        (0.8,2)
      };

\addplot[
        mark=*,
        black , dashed
      ] plot coordinates {
        (0.9,0)
        (0.9,2)
      };

\end{axis}
       \node[below] at (7.6,-0.06) {$0.9$};
              \node[below] at (2.5,4) {$s_L=0.8$};
       \node[below, rotate=90] at (6.9,1.6) {$s_R=0.2$};

       \draw[help lines, black, dashed] (4.85,0) grid (4.85,3.4);

        \node[below, rotate=90] at (4.4,1.7) {Indifferent voter};

\end{tikzpicture}
}
\caption{Linear rule and $n=3$.}
  \label{fig:parliamentlow}
\end{subfigure}
\caption{An example where parties propose $[\underline{x}_L,\overline{x}_L]=[0.2,0.4]$ and $[\underline{x}_R,\overline{x}_R]=[0.8,0.9]$. Parties' vote shares are $v_L=0.6$ and $v_R=0.4$. The electoral rule disproportionality determines parties' seat shares and hence the distribution of the represented ideologies in the elected body.}\label{fig:parliament}
\end{figure}

\medskip

\renewcommand{\thefigure}{3}
\begin{figure}[ht]
        \centering
        \resizebox{.5\linewidth}{!}{
\begin{tikzpicture}
\begin{axis}[
xmin=0,xmax=0.06,ymin=0.3,ymax=0.7,
    axis lines = left,
    xlabel = Disproportionality ($D$),
     xtick={0,0.02,0.04,0.06},
          xticklabels={0,0.02,0.04,0.06},
     scaled x ticks = false,
    ylabel = {Party Lists}
]
\addplot [name path=A,
    domain=0:0.0625, 
    samples=100, 
]
{3*0.4-min((-0.4-2 *(1/(1-8*x))+7*0.4*(1/(1-8*x))-6 *0.4^2*(1/(1-8*x)))/(-1-(1/(1-8*x))+2*0.4* (1/(1-8*x))),0.5))/2} node[pos=0.1,anchor=south west] {$\underline{x}_L^*$};

\addplot [ name path=B,
    domain=0:0.0625, 
    samples=100, 
]
{min((-0.4-2 *(1/(1-8*x))+7*0.4*(1/(1-8*x))-6 *0.4^2*(1/(1-8*x)))/(-1-(1/(1-8*x))+2*0.4* (1/(1-8*x))),0.5)} node[pos=0.1,anchor= north west] {$\overline{x}_L^*$};

\addplot[pattern=north east lines, pattern color=gray!50]fill between[of=A and B];


\addplot [name path=C,
    domain=0:0.0625, 
    samples=100, 
]
{1-(3*0.4-min((-0.4-2 *(1/(1-8*x))+7*0.4*(1/(1-8*x))-6 *0.4^2*(1/(1-8*x)))/(-1-(1/(1-8*x))+2*0.4* (1/(1-8*x))),0.5))/2} node[pos=0.1,anchor=north west]{$\overline{x}_R^*$};

\addplot [name path=D,
    domain=0:0.0625, 
    samples=100, 
    ]
  {1-min((-0.4-2 *(1/(1-8*x))+7*0.4*(1/(1-8*x))-6 *0.4^2*(1/(1-8*x)))/(-1-(1/(1-8*x))+2*0.4* (1/(1-8*x))),0.5)} node[pos=0.1,anchor=south west]{$\underline{x}_R^*$};


\addplot[pattern=dots, pattern color=gray!50]fill between[of=C and D];


\end{axis}
\end{tikzpicture}
}

\caption{An example of equilibrium lists considering the Linear rule for different levels of disproportionality $D$ and parties' ideal policies $({x}_L,{x}_R)=(0.4,0.6)$. The two most extreme candidates in party $j$ are denoted by $\underline{x}_j^*$ and $\overline{x}_j^*$.}
\label{fig:equilibrium}
\end{figure}


\medskip

\renewcommand{\thefigure}{A1}

\begin{figure}[ht]
\begin{subfigure}{.3\linewidth}
        \centering
        \resizebox{\linewidth}{!}{
\begin{tikzpicture}
\begin{axis}[
xmin=0.2,xmax=0.4,ymin=0,ymax=16,
    axis lines = left,
    ylabel = $h_L(x)$,
    xlabel = {$x$},
]

\addplot [name path=A,
    domain=0:1, 
    samples=100, line width=0.7mm
]
{135 + x *(-900 + 1500* x)}; 

\end{axis}
\end{tikzpicture}
}
\caption{$a=0$}
\end{subfigure}
\begin{subfigure}{.3\linewidth}
        \centering
        \resizebox{\linewidth}{!}{
\begin{tikzpicture}
\begin{axis}[
xmin=0.2,xmax=0.4,ymin=0,ymax=16,
    axis lines = left,
    ylabel = $h_L(x)$,
    xlabel = {$x$},
]

\addplot [name path=D,
    domain=0:1, 
    samples=100, line width=0.7mm
]
{70 + x *(-450 + 750* x)};

\end{axis}
\end{tikzpicture}
}
\caption{$a=0.5$}
\end{subfigure}
\begin{subfigure}{.3\linewidth}
        \centering
        \resizebox{\linewidth}{!}{
\begin{tikzpicture}
\begin{axis}[
xmin=0.2,xmax=0.4,ymin=0,ymax=16,
    axis lines = left,
    ylabel = $h_L(x)$,
    xlabel = {$x$},
]

\addplot [name path=D,
    domain=0:1, 
    samples=100, line width=0.7mm
]
{5};

\end{axis}
\end{tikzpicture}
}
\caption{$a=1$}
\end{subfigure}
\caption{The distribution of the represented ideologies in the elected body for party $L$ when proposing $[\underline{x}_{L}, \overline{x}_{L}] = [0.2, 0.4]$, for different values of $a$.}
\label{fig:quadratic}
\end{figure}


\medskip

\renewcommand{\thefigure}{A2}
\begin{figure}[ht]

        \centering
        \resizebox{0.5\linewidth}{!}{
\begin{tikzpicture}
\begin{axis}[
xmin=0,xmax=1,ymin=0,ymax=1.01,
    axis lines = left,
    xlabel = $v_j$,
    ylabel = {$s_j$},
]
\addplot [name path=A,
    domain=0:1, 
    samples=100, very thick
]
{x^1/(x^1+(1-x)^1)} node[pos=0.9,anchor=north] {$n=1$};

\addplot [ name path=B,
    domain=0:1, 
    samples=100, very thick
]
{x^3/(x^3+(1-x)^3)} node[pos=0.9,anchor=north] {$n=3$};

\addplot [name path=C,
    domain=0:1, 
    samples=100, very thick
]
{x^1000/(x^1000+(1-x)^1000)} node[pos=0.8,anchor=north] {$n\rightarrow \infty$};
\end{axis}
\end{tikzpicture}
}
\caption{Seat share allocation given parties' vote shares according to \textbf{\textit{Theil's rule}} where $s_j(v_j)=\frac{v_j^n}{v_j^n+(1-v_{-j})^n}$}
\label{fig:theil}
\end{figure}


\medskip

\renewcommand{\thefigure}{A3}

\begin{figure}[ht]
\begin{subfigure}{.5\linewidth}
        \centering
        \resizebox{\linewidth}{!}{
\begin{tikzpicture}

\begin{axis}[
xmin=0,xmax=1,ymin=0,ymax=1.01,
    axis lines = left,
    xlabel = $v_j$,
    ylabel = {$s_j$},
]
\addplot[domain=0:1/4, mark=*, black  ] {0};
\addplot[domain=1/4:2/4,mark=*, black  ] {1/3};
\addplot[name path=A, domain=2/4:3/4,mark=*, black  ] {2/3};
\addplot[name path=B, domain=3/4:1,mark=*, black  ] {1};
\addplot [name path=C,
    domain=0:1, 
    samples=100, very thick
]
{max(0,min((1-1.333)/2+1.333*x,1))} ;
\addplot [name path=D,
    domain=0:1, 
    samples=100, dotted, very thick
]
{x} ;

\addplot[darkgray, opacity=0.4] fill between[of=A and D, soft clip={domain=1/2:2/3}];
\addplot[darkgray, opacity=0.8] fill between[of=A and D, soft clip={domain=2/3:3/4}];
\addplot[darkgray, opacity=0.4] fill between[of=B and D, soft clip={domain=3/4:1}];

\end{axis}
\end{tikzpicture}
}
\caption{Council size $k=3$ and ``Slope''=1.333}
\end{subfigure}
\begin{subfigure}{0.5\linewidth}
        \centering
        \resizebox{\linewidth}{!}{
\begin{tikzpicture}
\begin{axis}[
xmin=0,xmax=1,ymin=0,ymax=1.01,
    axis lines = left,
    xlabel = $v_j$,
    ylabel = {$s_j$},
]
\addplot[domain=0:1/6, mark=*, black , thick] {0};
\addplot[domain=1/6:2/6, mark=*, black , thick] {1/5};
\addplot[domain=2/6:3/6, mark=*, black , thick] {2/5};
\addplot[name path=A, domain=3/6:4/6, mark=*, black , thick] {3/5};
\addplot[name path=B, domain=4/6:5/6, mark=*, black , thick] {4/5};
\addplot[name path=C, domain=5/6:6/6,mark=*, black ,  thick] {5/5};
\addplot [   domain=0:1, 
    samples=100, very thick
]
{max(0,min((1-1.2)/2+1.2*x,1))} ;
\addplot [name path=D,
    domain=0:1, 
    samples=100, dotted, very thick
]
{x} ;

\addplot[darkgray, opacity=0.4] fill between[of=A and D, soft clip={domain=3/6:3/5}];
\addplot[darkgray, opacity=0.8] fill between[of=A and D, soft clip={domain=3/5:4/6}];
\addplot[darkgray, opacity=0.4] fill between[of=B and D, soft clip={domain=4/6:4/5}];
\addplot[darkgray, opacity=0.8] fill between[of=B and D, soft clip={domain=4/5:5/6}];
\addplot[darkgray, opacity=0.4] fill between[of=C and D, soft clip={domain=5/6:1}];

\end{axis}
\end{tikzpicture}

}
\caption{Council size $k=5$ and ``Slope''=1.2}
\end{subfigure}
\caption{D'Hondt allocation method (steps) in a council of size $k$ and its continuous approximation using the \textit{Linear rule} (solid line) with slope $n=(k+1)/k$ (for the strictly increasing part). Dotted line is the 45 degree line (i.e., pure PR for $k\rightarrow \infty$). Light (dark) gray areas denote vote shares where the winner of the election is favored (harmed) by the allocation method.}\label{fig:steps}
\end{figure}

\end{document}
